import './App.css';
import React from 'react'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';

import Index1 from './index1';
import Register from './components/Register';
import Login from './components/Login';
import AddProduct from './components/AddProduct';
import ProductList from './components/ProductList';
import ProductDetail from './components/ProductDetail';
import TransactionHistory from './components/TransactionHistory';
import SubmitReview from './components/ubmitReview';
import SellerProducts from './components/SellerProducts';
import ProductReport from './components/ProductReport';
import CollectProductList from './components/CollectProductList';
import BuyerReview from './components/BuyerReview';
const App = () => (
  <Router>
    <Routes>
      <Route path='/' element={<Register></Register>}></Route>
      <Route path="/login" element={<Login></Login>} />
      <Route path="/index1/:userAddr" element={<Index1></Index1>}>
        {/* 商品添加 */}
        <Route path='AddProduct' element={<AddProduct></AddProduct>}></Route>
        {/* 所有商品展示 */}
        <Route path='ProductList' element={<ProductList></ProductList>}></Route>
        {/* 商品详情页 */}
        <Route path='ProductDetail/:productid' element={<ProductDetail></ProductDetail>}></Route>
        {/* 交易记录 */}
        <Route path='TransactionHistory' element={<TransactionHistory></TransactionHistory>}></Route>
        {/* 提交评价 */}
        <Route path='SubmitReview/:productid/:status' element={<SubmitReview></SubmitReview>}></Route>
        {/* 商品下架 */}
        <Route path='SellerProducts' element={<SellerProducts></SellerProducts>}></Route>
        {/* 举报 */}
        <Route path='ProductReport/:productid' element={<ProductReport></ProductReport>}></Route>
        {/* 我的收藏 */}
        <Route path='CollectProductList' element={<CollectProductList></CollectProductList>}></Route>
        {/* 我的商品评价记录 */}
        <Route path='BuyerReview' element={<BuyerReview></BuyerReview>}></Route>
      </Route>
      {/* <Route path="/adminindex1" element={<Adminindex1></Adminindex1>}>
        <Route path='admin' element={<AdminDashboard></AdminDashboard>}></Route>
      </Route> */}


    </Routes>
  </Router>
)
export default App;
